# -*- python -*-
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.


Import('env')

# TODO(robertm): get rid of this if possible
env.Append(CCFLAGS=['-fno-strict-aliasing'])

# NOTE: keep this sync'ed with build.scons
trusted_untrusted_shared = [
    'invoke.c',
    'module_init_fini.c',
    'nacl_srpc.c',
    'nacl_srpc_message.c',
    'rpc_log.c',
    'rpc_serialize.c',
    'rpc_service.c',
    'rpc_server_loop.c',
]

# NOTE: these files maybe candidates for a separate library
untrusted_only = [
    'accept.c',
    'accept_threaded.c',
    ]

libsrpc = env.NaClSdkLibrary('libsrpc',
                             trusted_untrusted_shared + untrusted_only,
                             LIBS=['imc_syscalls', 'pthread'])

header_install = env.AddHeaderToSdk(['nacl_srpc.h'])
env.Requires(libsrpc, header_install)
